package com.example.Holo.rework;

import android.content.Context;
import com.example.Holo.rework.core.Event;
import com.example.Holo.rework.dao.implementation.sqlite.android.SQLiteDaoFactory;
import com.example.Holo.rework.dao.interfaces.IDaoFactory;
import com.example.Holo.rework.services.implementation.ServiceFactory;
import com.example.Holo.rework.services.interfaces.IEventService;
import com.example.Holo.rework.services.interfaces.IServiceFactory;

import java.util.List;

import static java.lang.System.out;

public final class Application {

    public static final String DATABASE_NAME = "holo-events";

    public static void main(String[] args) {
        final Context context = null;
        final IDaoFactory daoFactory = new SQLiteDaoFactory(context, DATABASE_NAME);
        final IServiceFactory serviceFactory = new ServiceFactory(daoFactory);
        final IEventService eventService = serviceFactory.createEventService();
        final List<Event> allEvents = eventService.getAllEvents();
        for (final Event e : allEvents) {
            out.println(e);
        }
    }

}
